import Countdown from '@jmfe/jmr-countdown'
import React, { Component } from 'react'
import './index.scss'

export default class index extends Component {
	shouldComponentUpdate(nextProps) {
		if (
			this.props.systemTime === nextProps.systemTime ||
			this.props.salesTime === nextProps.salesTime
		) {
			return false
		}
		return true
	}

	render() {
		const { systemTime, salesTime, tpl } = this.props
		return (
			<div className="word-bg">
				<Countdown serverNow={systemTime} endTime={salesTime} prefixCls="word" tpl={tpl} />
				<div className="word-icon" />
			</div>
		)
	}
}
